package com.micangcaihang.micang.mvp.task.model;

import com.micangcaihang.common.baserx.RxSchedulers;
import com.micangcaihang.common.http.ApiResult;
import com.micangcaihang.common.http.RxHelper;
import com.micangcaihang.micang.entity.FileListEntity;
import com.micangcaihang.micang.http.FApiService;
import com.micangcaihang.micang.http.request.TaskAccessoryInfoRequest;
import com.micangcaihang.micang.mvp.task.contract.FTaskOnePledgeLeaseAccessoryContract;

import io.reactivex.Observable;

/**
 * <pre>
 *     author : Fandy
 *     e-mail : fandayongfly@gmail.com
 *     time   : 2017/07/17
 *     desc   : 风控-一抵租赁附件
 *     version: 1.0
 * </pre>
 */

public class FTaskOnePledgeLeaseAccessoryModel implements FTaskOnePledgeLeaseAccessoryContract.Model {
    /**
     * 获取附件信息2数据
     *
     * @param id
     * @return
     */
    @Override
    public Observable<ApiResult<FileListEntity>> getAccessoryInfoData(String id, String type) {
        return FApiService.<ApiResult<FileListEntity>>risk_files(id, type)
                .compose(RxSchedulers.observableIoToMain())
                .compose(RxHelper.handleResult());
    }

    /**
     * 保存信息
     *
     * @param request
     * @return
     */
    @Override
    public Observable<ApiResult<Void>> savaAccessoryInfoData(TaskAccessoryInfoRequest request) {
        return null;
    }
}
